/*-----------------------------------------------------------------------------
 * @file   board.h
 * @brief  Board Configure header file
 * @author WLH<wanglehui8357@163.com> Copyright (C) 2021~2099.
-----------------------------------------------------------------------------*/
#ifndef BOARD_H
#define BOARD_H

/*
 * Board Features
-------------------------------------------------------------------------------
|Processor      |GD32L235KBQ6 ARM Cortex-M23 Processor.
|               |64MHz System Freq / 128KB Flash / 16KB SRAM
-------------------------------------------------------------------------------
|clock sources  |24 MHz crystal oscillator
-------------------------------------------------------------------------------
|SD/MMC         |X
-------------------------------------------------------------------------------
|FRAM           |X
-------------------------------------------------------------------------------
|NOR-FLASH      |X
-------------------------------------------------------------------------------
|USB            |X
-------------------------------------------------------------------------------
|Debug port     |1 JTAG/SWD interface connector
-------------------------------------------------------------------------------
|USART/UART     |8
-------------------------------------------------------------------------------
|CAN-FD         |1
-------------------------------------------------------------------------------
|SPI            |X
-------------------------------------------------------------------------------
|IIC            |2
-------------------------------------------------------------------------------
|PWM            |X
-------------------------------------------------------------------------------
|LED            |2
-------------------------------------------------------------------------------
*/
#include "gd32l23x.h"
#include "systick.h"
#include "core_cm23.h"
#include "dbg_tool.h"

/*-----------------------------------------------------------------------------
 * Board oscillator settings
-----------------------------------------------------------------------------*/
#define BSP_BOARD_NAME "E1"
#define BSP_CPU_FREQ   64000000U /* Program clock frequency */

/*-----------------------------------------------------------------------------
 * NVIC Priority defined (<8)
-----------------------------------------------------------------------------*/
#define GPIO_IRQ_PRIORITY 0
#define DMAC_IRQ_PRIORITY 1
#define I2C_IRQ_PRIORITY  2
#define SPI_IRQ_PRIORITY  3
#define UART_IRQ_PRIORITY 5
#define ADC_IRQ_PRIORITY  6
#define CAN_IRQ_PRIORITY  6

/*-----------------------------------------------------------------------------
 * Event Flags define
-----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
 * Pin map defined
-----------------------------------------------------------------------------*/
// PA13_SWDIO
// PA14_SWCLK

/*----------------------------------------------------
 * LED PinMap:
----------------------------------------------------*/
// PA11_LED1
// PA12_LED2

/*----------------------------------------------------
 * USART/UART PinMap:
----------------------------------------------------*/
// PA2_LPUART0_TX
// PA3_LPUART0_RX

// PA9_USART0_TX
// PA10_USART0_RX

// PB0_UART4_TX
// PB1_UART4_RX

/*-----------------------------------------------------------------------------
 * Analog Front-End Controller (ADC)
-----------------------------------------------------------------------------*/
// PA1_ADC_IN1

/*-----------------------------------------------------------------------------
 * SPI Pin Map:
-----------------------------------------------------------------------------*/


/*------------------------------------------------------------------------------
 * I2C PinMap: Two-wire Interface
------------------------------------------------------------------------------*/
// PB6_I2C0_SCL
// PB7_I2C0_SDA
// PB5_I2C0_SMBA

// PA6_I2C2_SDA
// PA7_I2C2_SCL

/*------------------------------------------------------------------------------
 * PWM: PB13 PD01 PD03 PD05 PD07 PD11 PA02 PA07
------------------------------------------------------------------------------*/


/*-----------------------------------------------------------------------------
 * CAN Pin Map:
 *-----------------------------------------------------------------------------
 * PA4_CAN_RX
 * PA5_CAN_TX
-----------------------------------------------------------------------------*/


/*-----------------------------------------------------------------------------
 * GPIO     Pin     Map:                [Functions]
 *-----------------------------------------------------------------------------
 * OUT-0    PB03    HAL_GPIO_PIN_0
 * OUT-1    PA15    HAL_GPIO_PIN_1
 * OUT-2    PC14    HAL_GPIO_PIN_2
 * OUT-3    PC15    HAL_GPIO_PIN_3
 *-----------------------------------------------------------------------------
 * INT-0    PB04    HAL_GPIO_PIN_4
 * INT-1    PA08    HAL_GPIO_PIN_5
-----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
 * External Flash&FRAM Configuration
-----------------------------------------------------------------------------*/

#endif //~BOARD_H
